import { defineConfig } from '@umijs/max';
import routes from './routes';

import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin';

export default defineConfig({
  antd: {
    configProvider: {},
  },
  icons: {},
  access: {},
  model: {},
  initialState: {},
  request: {},
  layout: {
    // colorPrimary: '#5A54F9' 主题颜色
  },

  npmClient: 'npm',
  routes,
  // onRouteChange: onRouteChange,
  proxy: {
    '/api': {
      target: 'https://v3.okami.net.cn/',
      // target: 'https://minp.okami.net.cn/',
      changeOrigin: true,
      pathRewrite: { '^/api': '' },
    },
  },
  esbuildMinifyIIFE: true,
  chainWebpack(memo) {
    memo.plugin('monaco-editor-webpack-plugin').use(MonacoWebpackPlugin, [
      {
        // 支持代码高亮显示的语言
        languages: ['json'],
      },
    ]); 
  },
});
